
module.exports = function (Sequelize,sequelize) {
    const {STRING,INTEGER,DATE} = Sequelize
    const cloudFiles = sequelize.define('cloud_files', {
        id: {
            type: INTEGER,
            primaryKey: true,
            autoIncrement: true,
            comment: "id",
        },
        is_folder: {
            type: INTEGER,
            allowNull: true,
            comment: "是否文件夹",
        },
        create_by: {
            type: INTEGER,
            allowNull: true,
            comment: "创建人",
        },
        parent_id: {
            type: STRING,
            allowNull: true,
            comment: "父级id",
        },
        name: {
            type: STRING,
            allowNull: true,
            comment: "文件名称",
        },
        path: {
            type: STRING,
            allowNull: true,
            comment: "文件地址",
        },
        desc: {
            type: STRING,
            allowNull: true,
            comment: "文件描述",
        },
        type: {
            type: STRING,
            allowNull: true,
            comment: "文件类型",
        },
        size: {
            type: STRING,
            allowNull: true,
            comment: "大小",
        },
        seq: {
            type: INTEGER,
            defaultValue: 0,
            allowNull: true,
            comment: "排序号",
        },
        status: {
            type: INTEGER,
            defaultValue: 1,
            allowNull: true,
            comment: "上传状态",
        },

        del_flag: {
            type: INTEGER,
            defaultValue: 0,
            allowNull: true,
            comment: "是否删除",
        },
        create_time: {
            type: DATE,
            defaultValue: new Date(),
            allowNull: true,
            comment: "创建时间",
        },
        update_time: {
            type: DATE,
            defaultValue: new Date(),
            allowNull: true,
            comment: "修改时间",
        },

    }, {
        //使用自定义表名
        freezeTableName: true,
        //去掉默认的添加时间和更新时间
        timestamps: false,
    });
    return cloudFiles
}
